//
//  YSProgressLoadingView.h
//  YSKitDemo
//
//  Created by MOLBASE on 2018/8/15.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, YSProgressLoadingStyle) {
    YSProgressLoadingStyleCircle,         ///< 圆形进度条
    
};

@interface YSProgressLoadingView : UIView

+ (instancetype)loadingViewWithFrame:(CGRect)frame style:(YSProgressLoadingStyle)style;

/** 线条宽度：默认4 */
@property (nonatomic, assign) CGFloat lineWidth;

/** 圆弧半径：默认24 */
@property (nonatomic, assign) CGFloat radius;

/** 圆弧的背景颜色：默认半透明黑色 */
@property (nonatomic, strong) UIColor *bgColor;

/** 进度的颜色：默认白色 */
@property (nonatomic, strong) UIColor *strokeColor;

/** 进度，loadingStyle为YSLoadingStyleDeterminate时使用 */
@property (nonatomic, assign) CGFloat progress;

@property (nonatomic, copy) void (^progressChange)(YSProgressLoadingView *loadingView, CGFloat progress);

- (void)hideLoadingView;

// 在duration时间内加载，
- (void)startLoadingWithDuration:(NSTimeInterval)duration completion:(void (^)(YSProgressLoadingView *loadingView, BOOL finished))completion;

- (void)showFailure;

@end
